<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function handle() {
            let arr = [2, 3, 1, 0, 2, 5, 3]
            let map = new Map()
            for (let i = 0; i < arr.length; i++) {
                let val = map.get(arr[i])
                if (val) {
                    map.set(arr[i], map.get(arr[i]) + 1)
                } else {
                    map.set(arr[i], 1)
                }
            }

            let res = []
            for (let entries of map) {
                let [key, val] = entries
                if (val > 1) {
                    res.push(key)
                }
            }
            return res
        }

        console.log(handle())
    </script>
</body>

</html>